package com.jrx.anytxn.transaction.mapper.ext;

import com.jrx.anytxn.transaction.entity.TlPaymentMapping;
import com.jrx.anytxn.transaction.entity.TlWaivePaymentMapping;
import com.jrx.anytxn.transaction.mapper.base.TlPaymentMappingMapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ExtTlWaivePaymentMappingMapper extends TlPaymentMappingMapper {

    /**
     * 批量插入还款流水预订单映射
     *
     * @param paymentMappings 还款流水预订单映射信息
     * @return
     */
    int batchInsert(List<TlWaivePaymentMapping> paymentMappings);

    /**
     * 根据还款流水号及客户id查询还款流水与订单映射信息
     *
     * @param paymentSeq 还款流水好
     * @param customerId 客户id
     * @param tenantId 租户id
     * @return
     */
    List<TlWaivePaymentMapping> selectByPaymentSeqAndCustomerId(@Param(value = "paymentSeq") String paymentSeq,
                                                           @Param(value = "customerId") String customerId,
                                                           @Param(value = "tenantId") String tenantId);

    /**
     * 根据还订单号及客户id查询还款流水与订单映射信息
     *
     * @param loanId 订单号
     * @param customerId 客户id
     * @param tenantId 租户id
     * @return 还款流水号
     */
    List<String> selectByLoanIdAndCustomerId(@Param(value = "loanId") String loanId,
                                             @Param(value = "customerId") String customerId,
                                             @Param(value = "tenantId") String tenantId,
                                             @Param("productIds") List<String> productIds);

    /**
     * 按还款流水号查询还款流水预订单映射信息
     * 批次使用
     *
     * @param seqNoList
     * @return 还款流水映射
     */
    List<String> selectBySeqNoListForBatch(List<String> seqNoList);

    /**
     * 按还款流水号查询还款流水预订单映射信息
     *
     * @param seqNoList
     * @return 还款流水映射
     */
    List<String> selectBySeqNoList(@Param("seqNoList") List<String> seqNoList, @Param("customerId") String customerId,
                                   @Param("tenantId") String tenantId);
    /**
     * 按还款流水号查询还款流水预订单映射信息
     *
     * @param seqNoList
     * @param productIds
     * @return 还款流水映射
     */
    List<String> selectBySeqNoAndProductsList(@Param("seqNoList") List<String> seqNoList, @Param("customerId") String customerId,
                                   @Param("tenantId") String tenantId,@Param("productIds") List<String> productIds);
}